home *** CD-ROM | disk | FTP | other *** search
- /* -----------------------------------------------------------------------------
-
- Scan handler looking for Autodoc nodes. This handler simply looks for
- formfeeds and therefore won't work with all Autodocs (Commodore's Autodocs
- are handled properly).
-
- Scan handlers are plain functions (loadSeg()'ed): no standard C startup
- code and no library calls permitted. We have to put string constants into
- the code segment (DICE compiler: option -ms1).
-
- DICE:
-
- dcc autodoc.c -// -l0 -md -mRR -o golded:etc/scanner/autodoc
-
- ------------------------------------------------------------------------------
- */
-
- #include <exec/types.h>
-
- #define FORMFEED 12
-
- ULONG
- ScanHandlerGuide(__D0 ULONG len, __A0 char **text, __A1 ULONG *line)
- {
- // look for node header
-
- const char *version = "$VER: ADoc 1.4 (" __COMMODORE_DATE__ ")";
-
- if (**text == FORMFEED) {
-
- // look for beginning of header string (e.g. "Dos.Library/Open")
-
- while (len && (**text <= ' ')) {
-
- ++*text;
- --len;
- }
-
- // ignore first part of header string
-
- while (len && (**text != '/')) {
-
- ++*text;
- len--;
- }
-
- // extract node name
-
- if (len) {
-
- UWORD letters;
-
- ++*text;
- --len;
-
- for (letters = 0; len && ((*text)[letters] >= 32); --len)
-
- ++letters;
-
- return(letters);
- }
- }
-
- return(FALSE);
- }
-